home *** CD-ROM | disk | FTP | other *** search
/ Windows News 2005 November / WNnov2005.iso / Windows / Indispensables / Movie Collection / MovieCollection5403.exe / {app} / web / Default / index.xsl < prev    next >
Extensible Markup Language  |  2005-04-21  |  12KB  |  232 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:import href="header.xsl"/>
  4. <xsl:output method="html" media-type="text/html; charset=ISO-8859-1"/>
  5.  
  6. <xsl:template match="/">
  7.    <html>
  8.       <head>
  9.          <title><xsl:value-of select="datapacket/@title"/></title>
  10.          <link rel="stylesheet" type="text/css" href="mc.css" />
  11.       </head>
  12.       <body>
  13.          <table cellpadding="0" cellspacing="0" width="100%" border="0">
  14.          
  15.             <!-- EntΩte -->
  16.             <tr><td width="100%">
  17.                <xsl:call-template name="template_header" />
  18.             </td></tr>
  19.  
  20.             <tr>
  21.                <td width="100%">
  22.                   <table cellpadding="0" cellspacing="0" width="100%" border="0">
  23.                      <tr>
  24.                         <td width="100%" class="gt0deg">
  25.                            <xsl:if test="not(//datapacket/@php=1)"><a href="disconnect" class="lktoolbar">DΘconnecter</a> | </xsl:if><a href="mailto: babidyxp@free.fr" class="lktoolbar">Powered by MovieCollection ⌐ Babidyxp</a>
  26.                         </td>
  27.                         <td width="100%" class="gt0deg">
  28.                            <xsl:value-of select="datapacket/@servername" />
  29.                         </td>
  30.                      </tr>
  31.                   </table>
  32.                </td>
  33.             </tr>
  34.  
  35.             <!-- Fin EntΩte -->
  36.             <xsl:if test="//top10ajouts/@boxoffice=1">
  37.                <tr>
  38.                   <td width="100%" class="parAction">
  39.                      <table cellpadding="0" cellspacing="0">
  40.                         <tr>
  41.                            <td class="parAction">
  42.                               <img src="images/boxoffice.gif" />
  43.                            </td>
  44.                            <td class="parAction">
  45.                               Le box office
  46.                            </td>
  47.                         </tr>
  48.                      </table>
  49.                   </td>
  50.                </tr>
  51.                <tr>
  52.                   <td width="100%">
  53.                      <div align="center">
  54.                         <xsl:call-template name="boucle" />
  55.                      </div>
  56.                   </td>
  57.                </tr>
  58.             </xsl:if>
  59.  
  60.             <tr>
  61.                <td width="100%" class="parAction">
  62.                   <table cellpadding="0" cellspacing="0">
  63.                      <tr>
  64.                         <td class="parAction">
  65.                            <img src="images/i.p.search.gif" />
  66.                         </td>
  67.                         <td class="parAction">
  68.                            Rechercher un film
  69.                         </td>
  70.                      </tr>
  71.                   </table>
  72.                </td>
  73.             </tr>
  74.             
  75.             <tr><td width="100%">
  76.                <form name="formSearchFilms"  method="post" action="films" >
  77.                   <p style="margin: 10px;" />
  78.                   <div align="center">
  79.                      <table cellpadding="0" cellspacing="0" width="340" border="0">
  80.                         <tr><td width="100%" class="pageHeader"><img src="images/trans_pixel.gif" width="1" height="2" /></td></tr>
  81.                         <tr>
  82.                            <td width="100%" class="gt1">
  83.                               <p style="margin-top: 10px; margin-bottom: 10px; margin-right: 0px; margin-left: 10px;">
  84.                                  <b>Rechercher dans Movie Collection</b>
  85.                               </p>
  86.                               <p style="margin-top: 0px; margin-bottom: 0px; margin-right: 0px; margin-left: 10px;">
  87.                                  Collection:
  88.                               </p>
  89.                               <p style="margin-top: 0px; margin-bottom: 10px; margin-right: 0px; margin-left: 10px;">
  90.                                  <select name="selectCollection" style="width:310px" >
  91.                                     <option selected="1" value="-1">(Toutes)</option>
  92.                                     <xsl:for-each select="//collections/collection">
  93.                                        <option>
  94.                                           <xsl:attribute name="value">
  95.                                              <xsl:value-of select="@idx"/>
  96.                                           </xsl:attribute>
  97.                                           <xsl:value-of select="@nom"/>
  98.                                        </option>
  99.                                     </xsl:for-each>
  100.                                  </select>
  101.                               </p>
  102.                               <p style="margin-top: 0px; margin-bottom: 0px; margin-right: 0px; margin-left: 10px;">
  103.                                  CatΘgorie:
  104.                               </p>
  105.                               <p style="margin-top: 0px; margin-bottom: 10px; margin-right: 0px; margin-left: 10px;">
  106.                                  <select name="selectCategorie" style="width:310px" >
  107.                                     <option selected="1" value="-1">(Toutes)</option>
  108.                                     <xsl:for-each select="//categories/categorie">
  109.                                        <option>
  110.                                           <xsl:attribute name="value">
  111.                                              <xsl:value-of select="@idx"/>
  112.                                           </xsl:attribute>
  113.                                           <xsl:value-of select="@nom"/>
  114.                                        </option>
  115.                                     </xsl:for-each>
  116.                                  </select>
  117.                               </p>
  118.                               <p style="margin-top: 0px; margin-bottom: 0px; margin-right: 0px; margin-left: 10px;">
  119.                                  CritΦres:
  120.                               </p>
  121.                               <p style="margin-top: 0px; margin-bottom: 10px; margin-right: 0px; margin-left: 10px;">
  122.                                  <input type="text" name="textMots" size="45" maxlength="60" style="width:310px" value="" />
  123.                               </p>
  124.                               <p style="margin-top: 0px; margin-bottom: 10px; margin-right: 0px; margin-left: 10px;">
  125.                                  <input type="submit" name="submitRechercher" class="mcbutton" value="Rechercher" />
  126.                                    <a href="films">Voir Liste complΦte</a>
  127.                               </p>
  128.                            </td>
  129.                         </tr>
  130.                         <tr><td width="100%" class="pageHeader"><img src="images/trans_pixel.gif" width="1" height="2" /></td></tr>
  131.                      </table>
  132.  
  133.                      <!-- Dernier films ajoutΘs -->
  134.                      <br />
  135.                      <table cellpadding="0" cellspacing="0" width="340" border="0">
  136.                         <tr><td width="100%" class="pageHeader"><img src="images/trans_pixel.gif" width="1" height="2" /></td></tr>
  137.                         <tr>
  138.                            <td width="100%" class="gt1">
  139.                               <p style="margin-top: 10px; margin-bottom: 10px; margin-right: 0px; margin-left: 10px;">
  140.                                  <b><xsl:value-of select="count(//top10ajouts/top10ajout)" /> derniers films ajoutΘs</b>
  141.                               </p>
  142.                               <xsl:for-each select="//top10ajouts/top10ajout">
  143.                                  <p style="margin-top: 0px; margin-bottom: 0px; margin-right: 0px; margin-left: 10px;">
  144.                                     <xsl:value-of select="@dateajout" /> :
  145.                                     <a>
  146.                                        <xsl:attribute name="href">
  147.                                           film?idx=<xsl:value-of select="@idx"/>
  148.                                        </xsl:attribute>
  149.                                        <xsl:value-of select="@nom"/>
  150.                                     </a>
  151.                                  </p>
  152.                               </xsl:for-each>
  153.                            </td>
  154.                         </tr>
  155.                         <tr><td width="100%" class="pageHeader"><img src="images/trans_pixel.gif" width="1" height="2" /></td></tr>
  156.                      </table>
  157.  
  158.                      <!-- FilmsprΘtΘs -->
  159.                      <xsl:if test="not(count(//emprunts/emprunt)='0')">
  160.                      <br />
  161.                      <table cellpadding="0" cellspacing="0" width="340" border="0">
  162.                         <tr><td width="100%" class="pageHeader"><img src="images/trans_pixel.gif" width="1" height="2" /></td></tr>
  163.                         <tr>
  164.                            <td width="100%" class="gt1">
  165.                               <p style="margin-top: 10px; margin-bottom: 10px; margin-right: 0px; margin-left: 10px;">
  166.                                  <b><xsl:value-of select="count(//emprunts/emprunt)" /> film(s) prΘtΘ(s)</b>
  167.                               </p>
  168.                                  <xsl:for-each select="//emprunts/emprunt">
  169.                                     <p style="margin-top: 0px; margin-bottom: 0px; margin-right: 0px; margin-left: 10px;">
  170.                                        <a>
  171.                                           <xsl:attribute name="href">
  172.                                              film?idx=<xsl:value-of select="@idx"/>
  173.                                           </xsl:attribute>
  174.                                           <xsl:value-of select="@film"/>
  175.                                        </a>
  176.                                        <xsl:if test="@late_bool='1'">
  177.                                           <font color="red"> (En retard)</font>
  178.                                        </xsl:if>
  179.                                     </p>
  180.                                  </xsl:for-each>
  181.                            </td>
  182.                         </tr>
  183.                         <tr><td width="100%" class="pageHeader"><img src="images/trans_pixel.gif" width="1" height="2" /></td></tr>
  184.                      </table>
  185.                      </xsl:if>
  186.  
  187.                   </div>
  188.                </form>
  189.             </td></tr>
  190.          </table>
  191.       </body>
  192.    </html>
  193. </xsl:template>
  194.  
  195. <xsl:template name="boucle">
  196.    <xsl:param name="i" select="0" />
  197.    <xsl:param name="numVignette" select="5" />
  198.    <xsl:param name="count" select="ceiling(count(//top10ajouts/top10ajout) div $numVignette)" />
  199.  
  200.    <xsl:if test="$count > 0">
  201.       <table>
  202.          <tr>
  203.             <xsl:for-each select="//top10ajouts/top10ajout[floor((position()-1) div $numVignette)=$i]">
  204.                <td class="gtBoxOffice" width="143" align="center" valign="top">
  205.                   <img>
  206.                      <xsl:attribute name="src">getimg?idx=<xsl:value-of select="@idx"/></xsl:attribute>
  207.                   </img>
  208.                </td>
  209.             </xsl:for-each>
  210.          </tr>
  211.          <tr>
  212.             <xsl:for-each select="//top10ajouts/top10ajout[floor((position()-1) div $numVignette)=$i]">
  213.                <td class="gtBoxOffice" width="143" align="center" valign="top">
  214.                   <a><xsl:attribute name="href">film?idx=<xsl:value-of select="@idx"/></xsl:attribute><xsl:value-of select="@nom"/></a>
  215.                </td>
  216.             </xsl:for-each>
  217.          </tr>
  218.       </table>
  219.    </xsl:if>
  220.  
  221.  
  222.   <xsl:if test="$i < $count">
  223.     <xsl:call-template name="boucle">
  224.       <xsl:with-param name="i" select="($i)+1" />
  225.       <xsl:with-param name="count" select="$count" />
  226.     </xsl:call-template>
  227.   </xsl:if>
  228. </xsl:template>
  229.  
  230.  
  231. </xsl:stylesheet>
  232.